<?php
//echo session_id();
?>
<table width="100%" border="1">
<tr>
<td width="90%"><!-- The mo o 90% -->

<table width="100%" border="0"><!-- Bat dau bang xem du lieu -->
<tr>
<td>San Pham</td>
<td>So Luong</td>
<td>Tong</td>
<td>Edit</td>
</tr>
<?php
foreach($_SESSION['hoiCart'] as $productId=>$soluong)
{
//die("");
$query = "SELECT productname, productPrice FROM productdetails WHERE id = $productId";
$result = mysql_query($query);
list($productname,$productPrice) = mysql_fetch_array($result);
echo "<form action='index.php?page=update&id=$productId' method='post'>";
echo "<tr>";
echo "<td>".$productname."</td>";
echo "<td><input type='text' name='soluong' size='5' value=".$soluong."></td>";
$t = $giadt * $soluong;
$total = $total + $t;
echo "<td>".number_format($t)."</td>";
echo "<td>";
if($_SESSION['per'] >=2)
{
echo "<input type='submit' value='Update'>";
}
else
{
echo "Deny";	
}
echo "</td>";
echo "</tr>";
echo "</form>";
}
?>
</table><!-- ket thuc bang xem du lieu -->
</td><!-- The dong o 90% -->

<td width="10%"><!-- The mo o 10% -->

<table width="100%" border="0"><!-- Bat dau bang Delete -->
<tr>
<td>Delete</td>
</tr>
<form action="index.php?content=cart&do=delete" method="post">
<?php
foreach($_SESSION['hoiCart'] as $productId=>$soluong)
{
echo "<tr><td><input type='checkbox' name='del_".$productId."'></td></tr>";	
}
?>
</table><!-- Ket thuc bang Delete -->

</td><!-- The mo o 10% -->

</tr>
</table>
<p align="right">
<?php
if($_SESSION['per'] >=3)
{
?>
<input type="submit" value="Delete" /></p>
<?php
}
?>
</form>
<?php
echo "Tong don hang : ".number_format($total).$settingCurrency."<br>";
echo "<a href='index.php?content=cart&do=payment'><img src='image/mastercard.gif' border=0></a>";
?>